//删除有序数组中的重复项
//https://leetcode.cn/problems/remove-duplicates-from-sorted-array/description/

class Solution {
public:
    int removeDuplicates(vector<int>& nums) 
    {
        int slow = 0;
        for(int fast = 1; fast < nums.size(); fast++)
        {
            if(nums[fast] != nums[slow])
            {
                slow++;
                nums[slow] = nums[fast];
            }
        }
        return slow + 1;
    }
};